Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support
GS/OS
#6:    Drivers and GS/OS Direct Page

Written by:    Matt Deatherage                                     March 1989

This Technical Note corrects an error in the preliminary GS/OS documentation 
and provides an alternate suggestion for developers who are writing GS/OS 
drivers.
_____________________________________________________________________________

Preliminary GS/OS documentation, including the beta draft of GS/OS Reference, 
Volume 2, incorrectly state that locations $5A through $5F are available for 
device drivers, and that locations $66 through $6B are shared by device 
drivers and supervisory drivers (and may be corrupted by either a driver or 
supervisory driver call).

This is not correct.  The locations in question are used by GS/OS; destroying 
these locations can cause system failure and media corruption.

Drivers which require direct page space of their own should request it from 
the Memory Manager when they are started.  Upon receiving a call, a driver can 
save the value of the D register (containing the GS/OS direct page) and switch 
to its own direct page.  The driver may keep the value of its direct page 
inside the driver itself; no space on GS/OS direct page is available for this 
purpose.  The driver must restore the D register to point to the GS/OS direct 
page before returning from the call, and it should also dispose of its direct 
page space when it shuts down.

Note:    Drivers following this strategy must be sure to save and 
         restore the the D register on each call.  The location of the 
         GS/OS direct page is not guaranteed to remain static across calls.


Further Reference
_____________________________________________________________________________
    o    GS/OS Reference, Volume 2